Skip to content

Conversation

@adborbas
Copy link
Contributor

@adborbas adborbas commented Nov 28, 2025

Closes WOOMOB-1795

Description

The root of the issue was that on pull-to-refresh, we cleared the bookings from cache and only loaded the currently displayed tab's bookings into the store. This PR fixes this by handling pull-to-refresh across all three tabs rather than just the viewed tab.

On pull-to-refresh we manually clear the cache and then load all three tabs' bookings. This way, there is no data loss.

More info here

Test Steps

  1. Login to a CIAB store.
  2. Navigate to bookings
  3. Tap on All tab
  4. Note the items in the list
  5. Tap on the Today tab
  6. Preform a pull-to-refresh
  7. Once the refresh is done tap on All
  8. Note that the same items should be displayed.

Screenshots

Before After
Simulator Screen Recording - iPhone 17 Pro - 2025-12-01 at 08 20 44 Simulator Screen Recording - iPhone 17 Pro - 2025-12-01 at 08 22 26

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@adborbas adborbas added this to the 23.9 milestone Nov 28, 2025
@adborbas adborbas added the type: bug A confirmed bug. label Nov 28, 2025
@adborbas adborbas force-pushed the adborbas/woomob-1795 branch 2 times, most recently from 7ed97aa to 1529bb5 Compare November 28, 2025 11:11
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 28, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16417-3833147
Version23.7
Bundle IDcom.automattic.alpha.woocommerce
Commit3833147
Installation URL6dhjorvue2dh8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@adborbas adborbas force-pushed the adborbas/woomob-1795 branch from b19aaa2 to 21b3d5e Compare December 1, 2025 07:18
@adborbas adborbas changed the title Adborbas/woomob 1795 [Booking] Fix empty state after reload Dec 1, 2025
@adborbas adborbas marked this pull request as ready for review December 1, 2025 07:31
@adborbas adborbas requested review from RafaelKayumov, itsmeichigo and rtio and removed request for rtio December 1, 2025 07:39
@itsmeichigo itsmeichigo self-assigned this Dec 1, 2025
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as described 👍 I left some questions below but pre-approving.

Comment on lines 112 to 114
func onRefreshSelfAction(reason: String? = nil) async {
await withCheckedContinuation { continuation in
paginationTracker.resync(reason: Self.refreshCacheReason) {
paginationTracker.resync(reason: reason ?? Self.refreshCacheReason) {
Copy link
Contributor

@itsmeichigo itsmeichigo Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about keeping the refresh cache as the default value for simplicity? And should we rename the method to reloadData for clarity?

Suggested change
func onRefreshSelfAction(reason: String? = nil) async {
await withCheckedContinuation { continuation in
paginationTracker.resync(reason: Self.refreshCacheReason) {
paginationTracker.resync(reason: reason ?? Self.refreshCacheReason) {
func reloadData(reason: String = Self.refreshCacheReason) async {
await withCheckedContinuation { continuation in
paginationTracker.resync(reason: reason) {

Comment on lines 95 to 108
todayListViewModel
return todayListViewModel
case .upcoming:
upcomingListViewModel
return upcomingListViewModel
case .all:
allListViewModel
return allListViewModel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: why is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed at all! I was just fiddling around with the tabs, and I guess I haven't fully reverted one of my changes. I'll remove the returns.

/// Called when the user pulls down the list to refresh.
@MainActor
func onRefreshAction() async {
func onRefreshAction(reason: String? = nil) async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary? Unrelated but looks like the pull to refresh functionality doesn't work on the search view any more.

@adborbas adborbas merged commit 31c2496 into trunk Dec 1, 2025
13 checks passed
@adborbas adborbas deleted the adborbas/woomob-1795 branch December 1, 2025 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A confirmed bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants